home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / CDTools / MUIRexx / demos / MUIRexxDock / dock_mode.rexx < prev    next >
OS/2 REXX Batch file  |  1997-05-01  |  2KB  |  75 lines

  1. /* */
  2. options results
  3. parse arg m' 'n' 'mode
  4.  
  5. address dock
  6.  
  7. MUIA_Draggable = 0x80420b6e
  8.  
  9. FALSE = 0
  10. TRUE = 1
  11.  
  12. if (m ~= 0) & (n = 0) then do
  13.     getvar 'D'||m
  14.     n = result
  15.     i = 1
  16. end
  17. else i = n
  18.  
  19. if mode then do
  20.     do j = i to n
  21.         getvar 'B'||m||j
  22.         entry = result
  23.         if entry ~= '' then do
  24.             parse var entry type' ICON "'obj'"'
  25.             bcomm = ''
  26.             select
  27.                 when type = 'pop' then do
  28.                     parse var entry 'PCOMM "'bcomm'"'
  29.                     object = 'group POP'
  30.                 end
  31.                 otherwise do
  32.                     parse var entry 'PCOMM "'bcomm'"'
  33.                     object = type
  34.                 end
  35.             end
  36.             object ID m||j ATTRS MUIA_Draggable FALSE
  37.             if bcomm ~= '' then do
  38.                 bcomm = '"'bcomm'"'
  39.                 parse var entry 'PPORT "'bport'"'
  40.                 if bport ~= '' then bcomm = bcomm' PORT "'bport'"'
  41.                 callhook ID m||j PRESS COMMAND bcomm
  42.             end
  43.             parse var entry 'ACOMM "'bcomm'"'
  44.             if bcomm ~= '' then do
  45.                 bcomm = '"'bcomm'"'
  46.                 parse var entry 'APORT "'bport'"'
  47.                 if bport ~= '' then bcomm = bcomm' PORT "'bport'"'
  48.                 callhook ID m||j APP COMMAND bcomm
  49.             end
  50.             parse var entry 'DCOMM "'bcomm'"'
  51.             if bcomm ~= '' then do
  52.                 bcomm = '"'bcomm'"'
  53.                 parse var entry 'DPORT "'bport'"'
  54.                 if bport ~= '' then bcomm = bcomm' PORT "'bport'"'
  55.                 callhook ID m||j DROP COMMAND bcomm
  56.             end
  57.         end
  58.     end
  59. end
  60. else do
  61.     do j = i to n
  62.         getvar 'B'||m||j
  63.         parse var result type' ICON "'obj'"'
  64.         if m = 0 then type = 'button'
  65.         select
  66.             when type = 'pop' then object = 'group POP'
  67.             otherwise object = type
  68.         end
  69.         object ID m||j ATTRS MUIA_Draggable TRUE
  70.         callhook ID m||j DROP COMMAND """dock_change "m" "j" "obj" %s"""
  71.         callhook ID m||j PRESS
  72.         callhook ID m||j APP
  73.     end
  74. end
  75.